import { actionTypes } from '../../action/student/searchResult'
const initialState = {
    students: [],
    total: 0,
    isLoading: false
}
/**
 * 控制查询结果的reducer
 */
export default (state = initialState, { type, payload }) => {
    switch (type) {
        case actionTypes.setStudents:
            const { students, total } = payload
            return { ...state, students, total }
        case actionTypes.loading:
            return { ...state, isLoading: payload }
        default:
            return state
    }
}
